//
//  BGActivityViewController.m
//  bingke
//
//  Created by zhangkt zhangkt on 12-10-15.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "BGActivityViewController.h"

@implementation BGActivityViewController

@synthesize imageView;
@synthesize scrollView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) 
    {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    scrollView.contentSize = CGSizeMake(320, 500);
    scrollView.contentOffset = CGPointMake(0, 0);
    
    imageView.image = [UIImage imageNamed:@"缤客 账主界面-03.png"];
    NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"BGMenuView" owner:self options:nil];
    BGMenuView *footView = [array objectAtIndex:0];
    footView.frame = [BGMenuView getHideFrame];
    [self.view addSubview:footView];
    footView.backgroundColor = [UIColor clearColor];
    
    NSArray *headViewArray = [[NSBundle mainBundle] loadNibNamed:@"BGHeadView" owner:self options:nil];
    BGHeadView *headView = [headViewArray objectAtIndex:0];
    headView.frame = CGRectMake(0, 0, 320, 83);
    [self.view addSubview:headView];
    headView.backgroundColor = [UIColor clearColor];
    //[headView.searchBarText setAutocorrectionType:UITextAutocorrectionTypeNo];
    //支持SearchBar、TextField、UITextView，可以禁掉后面的尾巴。
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(64,38 , 65, 52);
    [button addTarget:self action:@selector(onButton) forControlEvents:UIControlEventTouchUpInside];
    button.backgroundColor = [UIColor clearColor];
    [footView addSubview:button];
}

- (void) onButton
{
    
}

- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
    NSLog(@"SEARCH");
    [searchBar resignFirstResponder];
}

- (void)viewDidUnload
{
    [self setScrollView:nil];
    [super viewDidUnload];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (IBAction)backButton:(id)sender 
{
    BGAppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
    [appDelegate.mainNavigationController popViewControllerAnimated:NO];
}

- (IBAction)eightDiscount:(id)sender 
{
    NSLog(@"88888888888");
}

- (IBAction)bargainSales:(id)sender 
{
    NSLog(@"bargainSales");
}

- (IBAction)joyous:(id)sender 
{
    NSLog(@"joyous");
    
    BGJoyousViewControll *joyousViewControll = [[BGJoyousViewControll alloc] initWithNibName:@"BGJoyousViewControll" bundle:nil];
    BGAppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
    [appDelegate.mainNavigationController pushViewController:joyousViewControll animated:NO];
    [joyousViewControll release];
    
    //BGMenuView *menuView = [[BGMenuView alloc] init];
    //[menuView hideMenu:sender];
}

- (IBAction)uniqlo:(id)sender 
{
    NSLog(@"uniqlo");
}

- (void)dealloc 
{
    [scrollView release];
    [super dealloc];
}
@end
